<template>
  <div ref="container" class="HomeFunc-container">
    <div class="HomeFunc-pic">
      <img :src="picUrl" />
    </div>
    <div class="HomeFunc-text">
      <span>{{ title }}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'homefunc',
  props: {
    picUrl: {
      type: String,
      default: ''
    },
    title: {
      type: String,
      default: ''
    },
    isColumn: {
      type: Boolean,
      default: false
    }
  },
  created() {
    if (this.isColumn) {
      this.$nextTick(() => {
        this.$refs.container.classList.add('directionColumn')
      })
    }
  }
}
</script>

<style lang="less" scoped>

</style>

<style lang="less">
.HomeFunc-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fff;
  .HomeFunc-pic {
    img {
      width: 50px;
    }
  }
  .HomeFunc-text {
    color: #000;
    font-size: 16px;
    text-decoration: none;
    margin-left: 15px;
  }
}

.directionColumn {
  flex-direction: column;
  .HomeFunc-text {
    color: #000;
    font-size: 16px;
    margin-left: 0;
    margin-top: 15px;
  }
}
</style>